<script setup>
import { useAppStore } from "@/store/modules/app";
const useApp = useAppStore();

const theme = computed(() => useApp.theme);

const onClickRight = () => {
  useApp.setTheme(theme.value === "dark" ? "light" : "dark");
};
</script>

<template>
  <van-nav-bar fixed placeholder @click-right="onClickRight">
    <template #right>
      <svg-icon
        class="text-[18px]"
        :name="theme === 'dark' ? 'light' : 'dark'"
      />
    </template>
  </van-nav-bar>
</template>

<style scoped></style>
